/** @jsxImportSource @emotion/react */
import * as React from "react";
import {
  CCell, Cell, Table, TableBody, TableRow, Text, TableHead,
} from "customize-easy-ui-component";
import {RepLink} from "../../common/base";
import {item宏观焊接, } from "./editorMacr";
import {useOmnipotentPref} from "../../hook/useOmnipotentPref";
import {TailMenRowIspCheck} from "../../contain/rarelyVary";

const tailRender=(orc: any, name: string,lix:number)=><>
  <CCell>{orc?.[name]?.r??'／'}</CCell>
  <CCell>{orc?.[name]?.m??'／'}</CCell>
</>;

export const 宏观检验报告= ({theme, orc, rep} :{theme: any, orc:any, rep:any}
) => {
  //const [line1, ...otherLines]=useMeasureTableCrit({rep,orc, config: config路线坡度, nseq:true,});
  const [renderBrkTest]=useOmnipotentPref({orc, config:item宏观焊接,
             tailRender, pcols:1, noNo:true, unitCel:true});
  return <>
    <div css={{"@media print": {paddingBottom: '3.5rem', pageBreakInside: 'avoid'}} }>
      <Text id='Structural' variant="h2" css={{textAlign: 'center', marginTop: '1rem',
      }}>罐体宏观检验报告</Text>
      <div css={{display: 'flex', justifyContent: 'space-between'}}>
        <Text></Text>
        <Text>报告编号：{rep.isp.no}</Text>
      </div>
    </div>
    <Table fixed={ ["5%","26%","%","13%","17%"] } css={{borderCollapse: 'collapse', "@media print": {marginTop: '-3.5rem'}}} tight  miniw={800}>
      <TableHead>
          <TableRow>
            <CCell colSpan={2}>检 验 项 目</CCell><CCell>检验要求</CCell><CCell>检验结果</CCell><CCell>备注</CCell>
          </TableRow>
      </TableHead>
      <TableBody>
        <RepLink rep={rep} tag={'Macroscopic'}>
          {renderBrkTest}
          <TableRow>
            <CCell>结果</CCell>
            <Cell colSpan={4}><div css={{minHeight: '2rem',whiteSpace:'pre-wrap'
            }}>{orc.宏观结果??'／'}</div></Cell>
          </TableRow>
        </RepLink>
      </TableBody>
    </Table>
    <TailMenRowIspCheck orc={orc} rep={rep} href={`/report/${rep?.modeltype}/ver/${rep?.modelversion}/${rep?.id}/ProjectList#ProjectList`}>
    </TailMenRowIspCheck>
  </>;
};
